package com.szr.leex.dao.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.domain.AuditorAware;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;

/**
 * jpa config
 * Created by WangChen on 2018/9/11 17:47.
 */
@Configuration
//@EnableJpaAuditing accepts one argument auditorAwareRef where we need to pass the name of the AuditorAware bean.
@EnableJpaAuditing(auditorAwareRef = "auditorAware")
public class JpaConfig {

    @Bean
    public AuditorAware<String> auditorAware() {
        return new AuditorAwareImpl();
    }
}
